package com.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import com.study.ExcludeFromComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 方式一:MyRibbonConfig.class与@ComponentScan不在同一个包下
 * 
 * 方式二:自定义不扫描的注解
 * @ComponentScan(excludeFilters = {@ComponentScan.Filter(type=FilterType.ANNOTATION, value=ExcludeFromComponentScan.class)})
 *
 */
@Configuration
@ExcludeFromComponentScan
public class MyRibbonConfig {
	
	@Bean
	public IRule ribbonRule() {

//		return new RandomRule();

		return new RoundRobinRule();
	}

}
